package Timer;

import java.util.Date;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

public class ExecutorsTest {

	public static void main(String[] args) {
		ScheduledExecutorService service = Executors.newScheduledThreadPool(2);

		service.scheduleAtFixedRate(new Runnable() {

			@Override
			public void run() {
				System.out.println(new Date().getTime());
			}
		}, 0, 1, TimeUnit.SECONDS);
	}

}
